﻿namespace PMIS.Common.Dialog
{
    public class DialogViewModelBase : BindableBase, IDialogAware
    {
        private string? _title = "";
        public string? Title
        {
            get
            {
                return _title;
            }
            set
            {
                SetProperty(ref _title, value);
            }
        }

        public DialogCloseListener RequestClose { get; }

        public bool CanCloseDialog()
        {
            return true;
        }

        public void CloseDialog(DialogResult result)
        {
            RequestClose.Invoke(result);
        }

        public void OnDialogClosed()
        {

        }

        public virtual void OnDialogOpened(IDialogParameters parameters)
        {

        }
    }
}
